<?php

class Engine_Core_Wrapper
{
    protected $__data__ = array();

	/**
	 * @var DB_Data_Collection
	 */
	protected $_collection;

    public function __construct()
    {}

	public function setCollection(&$collection)
	{
		$this->_collection = $collection;
	}

    function __set($name, $value)
    {
        $this->__data__[$name] = $value;
    }

    function __get($name)
    {
		$getter = 'get' . ucfirst($name);

		if (method_exists($this, $getter))
        {
			return $this->$getter();
		}
        elseif (@array_key_exists($name, $this->__data__))
        {
            return $this->__data__[$name];
        }
    }

	public function __isset($name)
	{
		return !empty($this->__data__[$name]);
	}

	public function toArray()
	{
		return $this->__data__;
	}
}